package com.hg.miaosha.common.config;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.plugins.PerformanceInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * mybatis-plus配置
 */
@Configuration
public class MybatisPlusConfig {

	/**
	 * SQL执行效率插件
	 */
	//@Profile({"dev", "test"})// 设置 dev test 环境开启
	//@Bean
	//public PerformanceInterceptor performanceInterceptor() {
	//	return new PerformanceInterceptor();
	//}

	/**
	 * 分页插件
	 */
	@Bean
	public PaginationInterceptor paginationInterceptor() {
		return new PaginationInterceptor();
	}
}